export interface NavLinkItem {
  id: string;
  name: string;
  url: string;
  icon?: string;
  background?: string;
}

export type SearchEngine = "google" | "bing" | "baidu" | "duckduckgo" | "yahoo" | "yandex";

export interface Settings {
  searchEngine: SearchEngine;
  navLinks: NavLinkItem[];
  background: string;
}

// 导入/导出设置的验证类型
export interface SettingsValidation {
  isValid: boolean;
  errors?: string[];
}

// 搜索引擎配置类型
export interface SearchEngineConfig {
  name: string;
  url: string;
  placeholder: string;
  icon?: string;
}

// 搜索引擎配置映射
export const searchEngineConfigs: Record<SearchEngine, SearchEngineConfig> = {
  google: {
    name: "Google",
    url: "https://www.google.com/search?q=",
    placeholder: "Search with Google...",
    icon: "https://www.google.com/favicon.ico",
  },
  bing: {
    name: "Bing",
    url: "https://www.bing.com/search?q=",
    placeholder: "Search with Bing...",
    icon: "https://www.bing.com/favicon.ico",
  },
  baidu: {
    name: "Baidu",
    url: "https://www.baidu.com/s?wd=",
    placeholder: "Search with Baidu...",
    icon: "https://www.baidu.com/favicon.ico",
  },
  duckduckgo: {
    name: "DuckDuckGo",
    url: "https://duckduckgo.com/?q=",
    placeholder: "Search privately with DuckDuckGo...",
    icon: "https://duckduckgo.com/favicon.ico",
  },
  yahoo: {
    name: "Yahoo",
    url: "https://search.yahoo.com/search?p=",
    placeholder: "Search with Yahoo...",
    icon: "https://www.yahoo.com/favicon.ico",
  },
  yandex: {
    name: "Yandex",
    url: "https://yandex.com/search/?text=",
    placeholder: "Search with Yandex...",
    icon: "https://yandex.com/favicon.ico",
  },
};
